/*
DECLARE @from datetime='2012-11-01'
DECLARE @to datetime='2012-11-11'

-- TODO: impostare qui i valori dei parametri.
EXECUTE [Caronte2012].[dbo].[jG_contabilitaRiepilogo] 
   @from
  ,@to
GO

exec dbo.[JG_ContabilitaRiepilogo] @from='2012-11-01 00:00:00',@to='2012-11-11 23:59:59'
*/
SELECT
    session_id,
    [ansi_defaults],
    [ansi_null_dflt_on],
    [ansi_nulls],
    [ansi_padding],
    [ansi_warnings],
    [arithabort],
    [concat_null_yields_null],
    [deadlock_priority],
    [quoted_identifier],
    [transaction_isolation_level]
FROM
    sys.dm_exec_sessions
WHERE
    session_id IN (76);
    
select p.query_plan, *
from sys.dm_exec_requests r
cross apply sys.dm_exec_query_plan(r.plan_handle) p
where r.session_id = 76